1 REM** THE QUEST**
2 REM**
3 REM** AN ADVENTURE GAME
4 REM
10 CLS
20 NR=19:NO=17:ND=6:NI=5
30 DIM R$(NR),OB(NO),OB$(NO),O2$(NO),MA(NR,ND)
40 PRINT "PLEASE STAND BY...":PRINT:PRINT
50 GOSUB 25000:GOSUB 26000:GOSUB 27000:REM INTITIALIZE ARAYS
60 R=1:IN=0:SF=0:FF=0:MX=1:GF=0
70 GOSUB 30000
80 CLS
90 GOSUB 700:GOSUB 500:GOSUB 600
91 REM
92 REM***PARSER
93 REM
100 PRINT:CM$="":INPUT "WHAT NOW";CM$
105 IF CM$="" THEN GOTO 100
110 C=0:V$="":N$=""
120 C=C+1:IF C>LEN(CM$) THEN GOTO 150
130 W$=MID$(CM$,C,1):IF W$=" " THEN GOTO 150
140 V$=V$+W$:GOTO 120
150 C=C+1:IF C>LEN(CM$) THEN GOTO 180
160 W$=MID$(CM$,C,1):IF W$="" THEN GOTO 180
170 N$=N$+W$:GOTO 150
180 IF V$="" THEN GOTO 100
190 IF LEN(V$)>3 THEN V$=LEFT$(V$,3)
200 IF LEN(N$)>3 THEN N$=LEFT$(N$,3)
210 IF N$="SHA" THEN N$="SAL"
220 IF N$="FOR" THEN N$="BOT"
259 REM
290 REM
480 GOTO 2000:REM EXECUTE VERB ROUTINE
490 REM
491 REM*** DIRECTIONS
496 REM
500 PRINT "YOU CAN GO:";
510 FOR I=0 TO 5
520 IF MA(R,I)>0 THEN  PRINT DI$(I);" ";
530 NEXT I
540 PRINT
550 RETURN
590 REM
596 REM
600 PRINT "YOU CAN SEE:"
610 FL=0:FOR I=0 TO NO-1
620 IF (OB(I) AND 127)=R THEN PRINT "";OB$(I):FL=1
630 NEXT I
640 IF FL=0 THEN PRINT "NOTHING OF INTEREST."
650 RETURN
690 REM
691 REM***ROOM DESCRIPTION
696 REM
700 PRINT:PRINT "YOU ARE ";R$(R)
710 RETURN
1000 IF NO=0 THEN RETURN
1010 FOR I=0 TO NO-1
1020 IF O2$(I)=N$ THEN FL=1:RO=OB(I):GOTO 1050
1030 NEXT I
1040 FL=0:RETURN
1050 RO=OB(I):IF RO>127 THEN RO=RO-128
1060 RETURN
1904 REM
1998 REM ROUTINE FOR THE VERB 'GO'
1999 REM
2000 IF V$<>"GO" THEN GOTO 2500
2010 IF N$="NOR" THEN DI=0:GOTO 2400
2020 IF N$="SOU" THEN DI=1:GOTO 2400
2030 IF N$="EAS" THEN DI=2:GOTO 2400
2040 IF N$="WES" THEN DI=3:GOTO 2400
2050 IF N$="UP" THEN DI=4:GOTO 2400
2060 IF N$="DOW" THEN DI=5:GOTO 2400
2070 IF N$="BOA" AND OB(11)=R+128 THEN R=13:GOTO 90
2390 PRINT "YOU CAN'T GO THERE!":GOTO 100
2391 REM
2400 IF MA(R,DI)>0 AND MA(R,DI)<128 THEN R=MA(R,DI):GOTO 100
2410 IF MA(R,DI)=128 THEN  PRINT "THE GUARD WON'T LET YOU!":GOTO 100
2480 GOTO 2390
2490 REM
2499 REM*** 'GET' ROUTINE
2500 IF V$<>"GET" AND V$<>"TAK" THEN  GOTO 2600
2510 GOSUB 1000
2520 IF FL=0 THEN PRINT "YOU CAN'T GET THAT!":GOTO 100
2530 IF RO=-1 THEN PRINT "YOU ALREADY HAVE IT!":GOTO 100
2540 IF OB(I)>127 THEN  PRINT "YOU CAN'T GET THAT!":GOTO 100
2550 IF RO<>R THEN  PRINT "THAT'S NOT HERE!":GOTO 100
2570 IF IN>NI THEN  PRINT "YOU CAN'T CARRY ANY MORE.":GOTO 100
2575 IF R=18 AND N$="RUB" THEN PRINT "CONGRATULATIONS!  YOU'VE WON!":GOTO 3430
2580 IN=IN+1:OB(I)=-1:PRINT "TAKEN.":GOTO 100
2600 IF V$<>"DRO" AND V$<>"THR" THEN GOTO 2700
2610 GOSUB 1000
2620 IF FL=0 OR RO<>-1 THEN PRINT "YOU DON'T HAVE THAT!":GOTO 100
2650 IN=IN-1:OB(I)=R:PRINT "DROPPED.":GOTO 100
2699 REM*** 'INVENTORY' ROUTINE
2700 IF V$<>"INV" AND V$<>"I" THEN GOTO 2800
2710 FL=0:PRINT "YOU ARE CARRYING:"
2720 FOR I=0 TO NO-1
2730 IF OB(I)=-1 THEN PRINT "";OB$(I):FL=1
2740 NEXT I
2750 IF FL=0 THEN PRINT "NOTHING"
2760 GOTO 100
2799 REM*** 'LOOK' ROUTINE
2800 IF V$<>"LOO" AND V$<>"L" THEN GOTO 2900
2810 IF N$<>"" THEN GOTO 2910
2820 GOTO 90
2899 REM*** 'EXAMINE' ROUTINE
2900 IF V$<>"EXA" THEN GOTO 3400
2910 IF N$<>"GRO" THEN GOTO 2940
2920 IF R<>6 THEN PRINT "IT LOOKS LIKE GROUND!":GOTO 100
2930 PRINT "IT LOOKS LIKE SOMETHING'S BURIED":PRINT"HERE.":GOTO 100
2940 REM
3000 GOSUB 1000
3010 IF RO<>R AND  RO<>-1 THEN PRINT "IT'S NOT HERE!":GOTO 100
3020 IF N$="BOT" THEN PRINT "THERE'S SOMETHING WRITTEN ON IT!":GOTO 100
3030 IF N$="CAS" THEN PRINT "THERE'S A JEWEL INSIDE!":GOTO 100
3040 IF N$="BAR" THEN PRINT "IT'S FILLED WITH RAINWATER.":GOTO 100
3390 PRINT "YOU SEE NOTHING UNUSUAL.":GOTO 100
3400 IF V$<>"QUI" THEN GOTO 3500
3410 PRINT "ARE YOU SURE YOU WANT TO QUIT   (Y/N)":INPUT QU$
3420 IF QU$="N" THEN GOTO 100
3430 PRINT "WOULD YOU LIKE TO PLAY AGAIN    (Y/N)";:INPUT QU$
3440 IF QU$="Y" THEN RUN
3450 IF QU$="N" THEN END
3460 GOTO 3430
3500 IF V$<>"REA" THEN GOTO 3700
3510 IF N$<>"DIA" THEN GOTO 3560
3520 IF OB(O)<>R AND OB(O)<>-1 THEN PRINT "THERE'S NO DIARY HERE!":GOTO 100
3530 PRINT "IT SAYS:  'ADD SODIUM CLORIDE"
3540 PRINT "PLUS THE FORMULA TO RAIN WATER,"
3550 PRINT "TO REACH THE OTHER WORLD'.":GOTO 100
3560 IF  N$<>"DIC" THEN GOTO 3590
3570 IF OB(4)<>R AND OB(4)<>-1 THEN PRINT "YOU DON'T SEE A DICTIONARY!":GOTO 100
3580 PRINT "IT SAYS:  'SODIUM CHLORIDE IS":PRINT "COMMON TABLE SALT.'":GOTO 100
3590 IF N$<>"BOT" THEN 3620
3600 IF OB(6)<>R AND OB(6)<>-1 THEN PRINT "THERE'S NO BOTTLE HERE!":GOTO 100
3610 PRINT "IT READS: 'SECRET FORMULA'":GOTO 100
3620 REM
3690 PRINT "YOU CAN'T READ THAT!":GOTO 100
3700 IF V$<>"OPE" THEN GOTO 3900
3710 IF N$<>"BOX" THEN GOTO 3740
3720 IF OB(1)<>R AND OB(1)<>-1 THEN PRINT "THERE'S NO BOX HERE!":GOTO 100
3730 OB(6)=R:PRINT "SOMETHING FELL OUT!":GOTO 100
3740 IF N$<>"CAB" THEN GOTO 3770
3750 IF R<>2 THEN PRINT "THERE'S NO CABINET HERE!":GOTO 100
3760 PRINT "THERE'S SOMETHING INSIDE!":OB(3)=2:GOTO 100
3770 IF N$<>"CAS" THEN GOTO 3820
3780 IF R<>18 THEN PRINT "THERE'S NO CASE HERE!":GOTO 100
3790 IF GF<>1 THEN PRINT "THE CASE IS ELECTRIFIED!":GOTO 100
3800 PRINT "THE GLOVES INSULATE AGAINST THE"
3810 PRINT "ELECTRICITY!  THE CASE OPENS!"
3820 IF GF=1 THEN OB(15)=18:GOTO 100
3890 PRINT "YOU CAN'T OPEN THAT!":GOTO 100
3900 IF V$<>"POU" THEN GOTO 4100
3910 IF N$<>"SAL" THEN GOTO 3960
3920 IF OB(3)<>R AND OB(3)<>-1 THEN PRINT "YOU DON'T HAVE THE SALT!":GOTO 100
3930 IF SF=1 THEN PRINT "THE SALT SHAKER IS EMPTY!":GOTO 100
3940 IF R=5 THEN MX=MX+1
3950 SF=1:PRINT "POURED!":GOTO 4010
3960 IF N$<>"BOT" THEN PRINT "YOU CAN'T POUR THAT!":GOTO 100
3970 IF OB(6)<>R AND  OB(3)<>-1 THEN PRINT "YOU DON'T HAVE THE BOTTLE!":GOTO 100
3980 IF FF=1 THEN PRINT "THE BOTTLE IS EMPTY!":GOTO 100
3990 IF R=5 THEN MX=MX+1
4000 FF=1:PRINT "POURED!"
4010 IF MX<3 THEN GOTO 100
4020 PRINT "THERE IS AN EXPLOSION!"
4030 PRINT "EVERYTHING GOES BLACK!"
4040 PRINT "SUDDENLY YOU ARE..."
4050 PRINT "...SOMEWHERE ELSE!"
4060 R=6:GOTO 90
4100 IF V$<>"CLI" THEN GOTO 4300
4110 IF N$<>"TRE" THEN GOTO 4140
4120 IF R<>7 THEN PRINT "THERE'S NO TREE HERE!":GOTO 100
4130 PRINT "YOU CAN'T REACH THE BRANCHES!":GOTO 100
4140 IF N$<>"LAD" THEN GOTO 4290
4150 IF R<>7 THEN GOTO 4180
4160 PRINT "THE LADDER SINKS UNDER YOUR     WEIGHT!"
4170 PRINT "IT HAS DISAPPEARED INTO THE     GROUND!":OB(7)=0:GOTO 100
4180 PRINT "WHATEVER FOR!":GOTO 100
4290 PRINT "IT WON'T DO ANY GOOD!":GOTO 100
4300 IF V$<>"JUM" THEN 4400
4310 IF R<>7 AND R<>8 THEN PRINT "WHEE!  THAT WAS FUN!":GOTO 100
4315 IF R=8 THEN 4350
4320 PRINT "YOU GRAB THE LOWEST BRANCH OF"
4330 PRINT "THE TREE AND PULL YOURSELF UP."
4340 R=8:GOTO 90
4350 PRINT "YOU GRAB A HIGHER BRANCH ON THE"
4360 PRINT "TREE AND PULL YOURSELF UP."
4370 R=19:GOTO 90
4400 IF V$<>"DIG" THEN GOTO 4500
4410 IF N$<>"HOL" AND N$<>"GRO" AND N$<>"" THEN PRINT "YOU CAN'T DIG THAT!":GOTO 100
4415 IF OB(8)<>R AND OB(8)<>-1 THEN PRINT "YOU DON'T HAVE A SHOVEL":GOTO 100
4420 IF R<>6 THEN PRINT "YOU DON'T FIND ANYTHING!":GOTO 100
4430 IF OB(10)<>0 THEN PRINT "THERE'S NOTHING ELSE HERE!":GOTO 100
4440 PRINT "THERE'S SOMETHING HERE!":OB(10)=6:GOTO 100
4500 IF V$<>"ROW" THEN 4600
4510 IF N$<>"BOA" AND N$<>"" THEN PRINT "HOW CAN YOU ROW THAT?":GOTO 100
4520 IF R<>13 THEN PRINT "YOU'RE NOT IN THE BOAT!":GOTO 100
4530 PRINT "YOU DON'T HAVE AN OAR!":GOTO 100
4600 IF V$<>"WAV" THEN 4700
4610 IF N$<>"FAN" THEN PRINT "YOU CAN'T WAVE THAT!":GOTO 100
4615 IF OB(12)<>R AND OB(12)<>-1 THEN PRINT "YOU DON'T HAVE THE FAN!":GOTO 100
4620 IF R<>13 THEN PRINT "YOU FEEL A REFRESHING BREEZE!":GOTO 100
4630 PRINT "A POWERFUL BREEZE PROPELS THE"
4640 PRINT "BOAT TO THE OPPOSITE SHORE!"
4650 IF OB(11)=140 THEN OB(11)=142:GOTO 100
4660 OB(11)=140:GOTO 100
4700 IF V$<>"LEA" AND V$<>"EXI" THEN GOTO 4800
4710 IF R<>13 THEN  PRINT"PLEASE GIVE A DIRECTION.":GOTO 100
4720 IF N$<>"BOA" AND N$<>"" THEN PRINT "HUH?":GOTO 100
4730 R=OB(11)-128:GOTO 90
4800 IF V$<>"FIG" THEN GOTO 4900
4810 IF N$="" THEN PRINT "WHOM DO YOU WANT TO FIGHT?":GOTO 100
4820 IF N$<>"GUA" THEN PRINT "YOU CAN'T FIGHT HIM.":GOTO 100
4830 IF R<>16 THEN PRINT "THERE'S NO GUARD HERE.":GOTO 100
4840 IF OB(10)<>-1 THEN PRINT "YOU DON'T HAVE A WEAPON!":GOTO 100
4850 PRINT "THE GUARD NOTICING YOUR SWORD,"
4860 PRINT "WISELY RETREATS INTO THE CASTLE."
4870 MA(16,0)=17:OB(13)=0:GOTO 100
4900 IF V$<>"WEA" THEN GOTO 5000
4910 IF N$<>"GLO" THEN PRINT "YOU CAN'T WEAR THAT.":GOTO 100
4920 IF OB(16)<>R AND OB(16)<>-1 THEN PRINT "YOU DON'T HAVE THE GLOVES.":GOTO 100
4930 PRINT "YOU ARE NOW WEARING THE GLOVES.":GF=1:GOTO 100
5000 REM
24900 PRINT "I DON'T KNOW HOW TO DO THAT.":GOTO 100
24990 REM
24991 REM THE FOLLOWING ROUTINE READS THE MAP INTO
24992 REM THE MAP ARRAY, MA(ROOM, DIRECTION).
24993 REM
25000 IF NR=0 THEN RETURN
25010 DI$(0)="NORTH":DI$(1)="SOUTH":DI$(2)="EAST"
25020 DI$(3)="WEST":DI$(4)="UP":DI$(5)="DOWN"
25030 FOR I=1 TO NR
25040 FOR J=0 TO ND-1
25050 READ MA(I,J)
25060 NEXT J
25070 NEXT I
25080 RETURN
25099 REM
25100 REM LIVING ROOM
25105 DATA 4,3,2,0,0,0
25110 REM KITCHEN
25115 DATA 0,0,0,1,0,0
25120 REM LIBRARY
25125 DATA 1,0,0,0,0,0
25130 REM FRONT YARD
25135 DATA 0,1,0,5,0,0
25140 REM GARAGE
25145 DATA 0,0,4,0,0,0
25150 REM OPEN FIELD
25155 DATA 9,7,0,0,0,0
25160 REM EDGE OF FOREST
25165 DATA 6,0,0,0,0,0
25170 REM BRANCH OF TREE
25175 DATA 0,0,0,0,0,7
25180 REM LONG, WINDING ROAD (1)
25185 DATA 0,6,10,0,0,0
25190 REM LONG, WINDING ROAD (2)
25195 DATA 11,0,0,9,0,0
25200 REM LONG, WINDING ROAD (3)
25205 DATA 0,10,0,12,0,0
25210 REM SOUTH BANK OF RIVER
25215 DATA 0,0,11,0,0,0
25220 REM BOAT
25225 DATA 0,0,0,0,0,0
25230 REM NORTH BANK OF RIVER
25235 DATA 15,0,0,0,0,0
25240 REM WELL-TRAVELED ROAD
25245 DATA 16,14,0,0,0,0
25250 REM SOUTH OF CASTLE
25255 DATA 128,15,0,0,0,0
25260 REM NARROW HALL
25265 DATA 0,16,0,0,18,0
25270 REM LARGE HALL
25275 DATA 0,0,0,0,0,17
25280 REM TOP OF TREE
25285 DATA 0,0,0,0,0,8
25900 REM
25910 REM THE FOLLOWING SUBROUTINE READS THE OBJECT DATA
25920 REM INTO THE THREE OBJECT ARRAYS, OB(X), OB$(X), AND
25930 REM 00$(X)
25940 REM
26000 IF NO=0 THEN RETURN
26010 FOR I=0 TO NO-1
26020 READ OB$(I),O2$(I),OB(I)
26030 NEXT I
26040 RETURN
26099 REM
26100 REM OBJECT #0
26105 DATA AN OLD DIARY, DIA, 1
26110 REM OBJECT #1
26115 DATA A SMALL BOX, BOX, 1
26120 REM OBJECT #2
26125 DATA CABINET, CAB, 130
26130 REM OBJECT #3
26135 DATA A SALT SHAKER, SAL, 0
26140 REM OBJECT #4
26145 DATA A DICTIONARY, DIC, 3
26150 REM OBJECT #5
26155 DATA WOODEN BARREL, BAR, 133
26160 REM OBJECT #6
26165 DATA A SMALL BOTTLE, BOT, 0
26170 REM OBJECT #7
26175 DATA A LADDER, LAD, 4
26180 REM OBJECT #8
26185 DATA A SHOVEL, SHO, 5
26190 REM OBJECT #9
26195 DATA A TREE, TRE, 135
26200 REM OBJECT #10
26205 DATA A GOLDEN SWORD, SWO, 0
26210 REM OBJECT #11
26215 DATA A WOODEN BOAT, BOA, 140
26220 REM OBJECT #12
26225 DATA A MAGIC FAN, FAN, 8
26230 REM OBJECT #13
26235 DATA A NASTY LOOKING GUARD, GUA, 144
26240 REM OBJECT #14
26245 DATA A GLASS CASE, CAS, 146
26250 REM OBJECT #15
26255 DATA A GLOWING RUBY, RUB, 0
26260 REM OBJECT #17
26265 DATA A PAIR OF RUBBER GLOVES, GLO, 19
26990 REM
27000 R$(1)="IN YOUR LIVING ROOM."
27010 R$(2)="IN THE KITCHEN."
27020 R$(3)="IN THE LIBRARY."
27030 R$(4)="IN THE FRONT YARD."
27040 R$(5)="IN THE GARAGE."
27050 R$(6)="IN AN OPEN FIELD."
27060 R$(7)="AT THE EDGE OF A FOREST."
27070 R$(8)="ON A BRANCH OF A TREE."
27080 R$(9)="ON A LONG, WINDING ROAD."
27090 R$(10)="ON A LONG, WINDING ROAD."
27100 R$(11)="ON A LONG, WINDING ROAD."
27110 R$(12)="ON THE SOUTH BANK OF A  RIVER."
27120 R$(13)="INSIDE THE WOODEN BOAT."
27130 R$(14)="ON THE NORTH BANK OF A  RIVER."
27140 R$(15)="ON A WELL-TRAVELED ROAD."
27150 R$(16)="IN FRONT OF A LARGE     CASTLE."
27160 R$(17)="IN A NARROW HALL."
27170 R$(18)="IN A LARGE HALL."
27180 R$(19)="ON TOP OF A TREE."
29900 RETURN
29990 REM
30000 GOSUB 40000:PRINT "ALL YOUR LIFE YOU HAD HEARD THE" 
30005 PRINT "STORIES ABOUT YOUR CRAZY UNCLE"
30010 PRINT "SIMON.  HE WAS AN INVENTOR, WHO"
30020 PRINT "KEPT DISAPPEARING FOR LONG"
30030 PRINT "PERIODS OF TIME, NEVER TELLING"
30040 PRINT "ANYONE WHERE HE HAD BEEN."
30050 PRINT;:INPUT A
30060 PRINT "YOU NEVER BELIEVED THE STORIES,"
30070 PRINT "BUT WHEN YOUR UNCLE DIED AND"
30080 PRINT "LEFT YOU HIS DIARY, YOU LEARNED"
30090 PRINT "THAT THEY WERE TRUE. YOUR UNCLE"
30100 PRINT "HAD DISCOVERED A MAGIC LAND,"
30105 PRINT "AND A SECRET FORMULA THAT COULD"
30110 PRINT "TAKE HIM THERE.  IN THAT LAND"
30120 PRINT "WAS A MAGIC RUBY, AND IN HIS"
30130 PRINT "DIARY CONTAINED THE INSTRUCT-"
30140 PRINT "IONS FOR GOING THERE TO FIND IT.";
30150 INPUT A
30160 RETURN
40000 CLS:PRINT "***********THE QUEST************"
40010 PRINT "BY CHRISTOPHER LAMPTON"
40020 PRINT:PRINT "MC-10 PORT BY ERIC UNDERHILL"
40030 PRINT:RETURN
